
import { FINDUSERANDPASS } from "./sql"
import { LoginOpt } from "./types"

import curd from '../../common/services/curd'

class LoginService {
    /**
     * 查询该用户
     * @param username 
     * @param passwrod 
     */
    async vertifyuserAndPass(username: string, passwrod: string): Promise<[boolean, LoginOpt]> {
        // 校验密码
        const ret: any = await curd.get(FINDUSERANDPASS, username, passwrod)
        const user = ret[0]


        return [ret.length > 0, user]
    }
}

export default new LoginService